import Vue from 'vue';
import Router from 'vue-router';
import axios from 'axios';
axios.defaults.baseURL = 'http://weixin.zihuayuedu.com/weixin';
axios.defaults.headers.post['Content-Type'] = 'application/json';
Vue.prototype.$http = axios;
import store from '../store/store.js';
Vue.use(Router).use(store);

export default new Router({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes: [{
      path: '/',
      redirect: {
        path: '/paradd'
      }
    },
    // 家长添加学生
    {
      path: '/paradd',
      component: () => import('../views/add/ParAdd.vue'),
      children: [{
          path: '',
          component: () => import('../views/add/SelectArea.vue'),
        },
        {
          path: 'school',
          component: () => import('../views/add/SelectSchool.vue'),
        },
        {
          path: 'year',
          component: () => import('../views/add/SelectYear.vue'),
        },
        {
          path: 'class',
          component: () => import('../views/add/SelectClass.vue'),
        }
      ]
    },
    // 老师绑定学校班级
    {
      path: '/teaadd',
      component: () => import('../views/add/TeaAdd.vue'),
      children: [{
          path: '',
          component: () => import('../views/add/SelectArea.vue'),
        },
        {
          path: 'school',
          component: () => import('../views/add/SelectSchool.vue'),
        },
        {
          path: 'account',
          component: () => import('../views/add/TeaAccount.vue'),
        }
      ]
    },
    // 家长查看学生的作业列表（未完成、已签名、未签名）
    {
      path: '/parjoblist',
      name: 'parjoblist',
      component: () => import( /* webpackChunkName: "about" */ '../views/joblist/ParJobList.vue'),
    },
    // 老师查看已发布的作业列表
    {
      path: '/teajoblist',
      name: 'teajoblist',
      component: () => import( /* webpackChunkName: "about" */ '../views/joblist/TeaJobList.vue'),
    },
    // 老师查看某个班级学生作业（未完成、未批阅、已批阅）
    {
      path: '/stulist',
      name: 'stulist',
      component: () => import( /* webpackChunkName: "about" */ '../views/stulist/StuList.vue')
    },
    // 家长查看某个学生作业信息
    {
      path: '/parentsjob',
      name: 'ParentsJob',
      component: () => import( /* webpackChunkName: "about" */ '../views/job/ParentsJob.vue')
    },
    // 老师查看某个学生作业信息
    {
      path: '/teacherjob',
      name: 'teacherjob',
      component: () => import( /* webpackChunkName: "about" */ '../views/job/TeacherJob.vue')
    }
  ]
});